package com.sicnu.resources;

import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author 29718
 */
@SpringBootApplication
@EnableScheduling
@EnableTransactionManagement
@Slf4j
@MapperScan("com.sicnu.resources.mapper")
public class ResourcesApp {
    public static void main(String[] args) {
        SpringApplication.run(ResourcesApp.class, args);
    }
    @Bean
    public RestHighLevelClient restHighLevelClient() {
        return new RestHighLevelClient(RestClient.builder(
                HttpHost.create("http://172.19.112.1:9200")
        ));
    }
}